package com.uzai.console.vo.pyq.pyqjobdetail;

import com.uzai.common.enums.PyqJobDetailStatusEnum;
import com.uzai.console.common.utils.DateUtil;
import com.uzai.console.vo.device.DeviceInfoVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @Auther: liuqi
 * @Date: 2021/8/10 14:58
 * @Description:
 */
@ApiModel("朋友圈发送明细详情列表")
public class PyqJobDetailVo {
    private static final long serialVersionUID = -489854591441285414L;
    @ApiModelProperty("主键ID")
    private String id;
    @ApiModelProperty("版本")
    private Long version;
    @ApiModelProperty("运营商id")
    private Long merId;
    @ApiModelProperty("朋友圈发送任务id")
    private Long jobId;
    @ApiModelProperty("job状态 0未发送 1发送中 2暂停 3已完成")
    private Integer jobStatus;
    @ApiModelProperty("状态 0未发送 1发送中 2暂停 3已发送 4已删除朋友圈 5发送失败")
    private Integer status;
    @ApiModelProperty("机器人唯一编号")
    private Long deviceUniqueId;
    @ApiModelProperty("机器人类型")
    private Integer deviceType;
    @ApiModelProperty("朋友圈类型 0商品 1图文 2悠哉精选(淘宝) 3悠哉精选(拼多多) 10悠友圈")
    private Integer type;
    @ApiModelProperty("平台 0淘宝 1京东 2拼多多 3唯品会 20图文")
    private Integer platform;
    @ApiModelProperty("发送来源（0手动发送；1自动发圈；2自动跟发）")
    private Integer source;
    @ApiModelProperty("商品链接/id")
    private String itemId;
    @ApiModelProperty("商品id后半部分")
    private String itemTailId;
    @ApiModelProperty("淘宝商品淘口令")
    private String itemPwd;
    @ApiModelProperty("打开淘宝url")
    private String pwdShortUrl;
    @ApiModelProperty("优惠券id")
    private String couponId;
    @ApiModelProperty("优惠券金额")
    private Double couponVal;
    @ApiModelProperty("券后价")
    private Double finalPrice;
    @ApiModelProperty("朋友圈id,发送成功后返回的id")
    private String pyqId;
    @ApiModelProperty("发送时间")
    private Integer sendTime;
    @ApiModelProperty("朋友圈内容")
    private String content;
    @ApiModelProperty("朋友圈图片（JSON数组）")
    private String imgs;
    @ApiModelProperty("评论内容")
    private String commentContent;
    @ApiModelProperty("失败原因")
    private String failMsg;
    @ApiModelProperty("创建时间")
    private Integer createTime;
    @ApiModelProperty("修改时间")
    private Integer updateTime;

    @ApiModelProperty("机器人信息")
    private DeviceInfoVo deviceInfoVo;

    @ApiModelProperty("距离现在的时间差")
    private Integer sendTimeFromNow;

    @ApiModelProperty("朋友圈视频号信息")
    private String pyqVideoNumber;

    @ApiModelProperty("媒体信息列表")
    private String feedMediaList;

    @ApiModelProperty("朋友圈附件类型(0-链接；2-图片;3-短视频;4-长视频;5-视频号)")
    private Integer attachType;

    @ApiModelProperty("朋友圈附件类型(0-链接；2-图片;3-短视频;4-长视频;5-视频号)")
    private String attachTypeName;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public Long getMerId() {
        return merId;
    }

    public void setMerId(Long merId) {
        this.merId = merId;
    }

    public Long getJobId() {
        return jobId;
    }

    public void setJobId(Long jobId) {
        this.jobId = jobId;
    }

    public Integer getJobStatus() {
        return jobStatus;
    }

    public void setJobStatus(Integer jobStatus) {
        this.jobStatus = jobStatus;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getDeviceUniqueId() {
        return deviceUniqueId;
    }

    public void setDeviceUniqueId(Long deviceUniqueId) {
        this.deviceUniqueId = deviceUniqueId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getPlatform() {
        return platform;
    }

    public void setPlatform(Integer platform) {
        this.platform = platform;
    }

    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId;
    }

    public String getCouponId() {
        return couponId;
    }

    public void setCouponId(String couponId) {
        this.couponId = couponId;
    }

    public Double getCouponVal() {
        return couponVal;
    }

    public void setCouponVal(Double couponVal) {
        this.couponVal = couponVal;
    }

    public Double getFinalPrice() {
        return finalPrice;
    }

    public void setFinalPrice(Double finalPrice) {
        this.finalPrice = finalPrice;
    }

    public String getPyqId() {
        return pyqId;
    }

    public void setPyqId(String pyqId) {
        this.pyqId = pyqId;
    }

    public Integer getSendTime() {
        return sendTime;
    }

    public void setSendTime(Integer sendTime) {
        this.sendTime = sendTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImgs() {
        return imgs;
    }

    public void setImgs(String imgs) {
        this.imgs = imgs;
    }

    public String getCommentContent() {
        return commentContent;
    }

    public void setCommentContent(String commentContent) {
        this.commentContent = commentContent;
    }

    public Integer getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Integer createTime) {
        this.createTime = createTime;
    }

    public Integer getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Integer updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(Integer deviceType) {
        this.deviceType = deviceType;
    }

    public DeviceInfoVo getDeviceInfoVo() {
        return deviceInfoVo;
    }

    public void setDeviceInfoVo(DeviceInfoVo deviceInfoVo) {
        this.deviceInfoVo = deviceInfoVo;
    }

    public String getFailMsg() {
        return failMsg;
    }

    public void setFailMsg(String failMsg) {
        this.failMsg = failMsg;
    }

    public Integer getSendTimeFromNow() {
        if(getStatus().intValue() >= PyqJobDetailStatusEnum.SENDED.getValue()){
            if(sendTime != null && DateUtil.getNowTime()-sendTime > 0){
                sendTimeFromNow = DateUtil.getNowTime()-sendTime;
            }
        }
        return sendTimeFromNow;
    }

    public void setSendTimeFromNow(Integer sendTimeFromNow) {
        this.sendTimeFromNow = sendTimeFromNow;
    }

    public Integer getSource() {
        return source;
    }

    public void setSource(Integer source) {
        this.source = source;
    }

    public String getItemTailId() {
        return itemTailId;
    }

    public void setItemTailId(String itemTailId) {
        this.itemTailId = itemTailId;
    }

    public String getItemPwd() {
        return itemPwd;
    }

    public void setItemPwd(String itemPwd) {
        this.itemPwd = itemPwd;
    }

    public String getPwdShortUrl() {
        return pwdShortUrl;
    }

    public void setPwdShortUrl(String pwdShortUrl) {
        this.pwdShortUrl = pwdShortUrl;
    }

    public String getPyqVideoNumber() {
        return pyqVideoNumber;
    }

    public void setPyqVideoNumber(String pyqVideoNumber) {
        this.pyqVideoNumber = pyqVideoNumber;
    }

    public String getFeedMediaList() {
        return feedMediaList;
    }

    public void setFeedMediaList(String feedMediaList) {
        this.feedMediaList = feedMediaList;
    }

    public Integer getAttachType() {
        return attachType;
    }

    public void setAttachType(Integer attachType) {
        this.attachType = attachType;
    }

    public String getAttachTypeName() {
        return attachTypeName;
    }

    public void setAttachTypeName(String attachTypeName) {
        this.attachTypeName = attachTypeName;
    }
}